﻿@model BrnMall.Web.Mobile.Models.ProductSuitListModel
@{
    Layout = null;
}
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>优惠套装-@{@WorkContext.MallConfig.SiteTitle}触屏版</title>
    @Html.Raw(WorkContext.MallConfig.SEOKeyword)
    @Html.Raw(WorkContext.MallConfig.SEODescription)
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link href="@{@WorkContext.CSSCDN}/mobile/css/base.css" rel="stylesheet" type="text/css">
    <link href="@{@WorkContext.CSSCDN}/mobile/css/content.css" rel="stylesheet" type="text/css">
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/utils.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/common.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/product.js" type="text/javascript"></script>
    <script type="text/javascript">
        uid = @WorkContext.Uid;
        pid = @Model.Pid;
        isGuestSC = @WorkContext.MallConfig.IsGuestSC;
    </script>
</head>

<body>
<header>
  <div class="new-header">
    <a href="javascript:pageBack()" class="new-a-back"><span>返回</span></a>
    <h2>优惠套装</h2>
    <a href="javascript:navSH()" class="new-a-brn"><span>BRN键</span></a> 
  </div>
  <div class="new-brn-tab" id="nav" style=" display:none;">
    <div class="new-tbl-type"> 
    <a href="@Url.Action("index", "home")" class="new-tbl-cell"><span class="icon">首页</span><p style="color:#6e6e6e;">首页</p></a> 
    <a href="@Url.Action("list", "category")" class="new-tbl-cell"><span class="icon2 on">分类搜索</span><p style="color:#6e6e6e;" class="on">分类搜索</p></a> 
    <a href="@Url.Action("index", "cart")" class="new-tbl-cell"><span class="icon3">购物车</span><p style="color:#6e6e6e;">购物车</p></a> 
    <a href="@Url.Action("index", "ucenter")" class="new-tbl-cell"><span class="icon4 on">个人中心</span><p style="color:#6e6e6e;" class="on">个人中心</p></a> 
    </div>
  </div>
</header>

<div class="listXHbox"> 
@for (int i = 1; i <= Model.SuitProductList.Count; i++)
{
  <div class="listXH @{if(i!=1){<text>open</text>}}">
    <h3 onclick="selectSuit(@i)" id="suit@{@i}">优惠套装@{@i}<span class="price"></span><span class="icon-arr"></span></h3>
    <ul class="listUL">
        @{
        decimal suitAmount = 0M;
        decimal suitDiscount = 0M;
        List<ExtSuitProductInfo> extSuitProductList = Model.SuitProductList[i - 1].Value;
        }
        @foreach (ExtSuitProductInfo info in extSuitProductList)
        {
        suitAmount += info.Number * (info.ShopPrice - info.Discount);
        suitDiscount += info.Number * info.Discount;
        <li><a href="@Url.Action("product", new RouteValueDictionary { { "pid", info.Pid } })">
        <div class="p-img"><img src="@{@WorkContext.ImageCDN}/upload/store/@Model.ProductInfo.StoreId/product/show/thumb60_60/@Model.ProductInfo.ShowImg" width="60" height="60"></div>
        <div class="p-info"><h5 class="p-name">@info.Name</h5><div class="p-price"></div></div>
        </a></li>
        }
    </ul>
    <div class="jsxx">
      <div class="total">优惠套装@{@i}： <span class="p-price">￥@suitAmount</span><span class="o-price"><del>￥@Html.Raw((suitAmount + suitDiscount).ToString())</del></span></div>
      <div> <i class="icon-bg02">立省￥@suitDiscount</i> </div>
      <div class="jsxxBT"><a href="javascript:addSuitToCart(@Model.SuitProductList[i - 1].Key.PmId,1,1)" class="redBt">加入购物车</a></div>
    </div>
  </div>
}
</div>
<script type="text/javascript">
    function selectSuit(i) {
        for (var j = 1; j < @Model.SuitProductList.Count; j++) {
            document.getElementById("suit" + j).className = "listXH open";
        }
        document.getElementById("suit" + i).className = "listXH";
    }
</script>

<div id="addResult1" class="bg" style="display:none;position:absolute;left:0px;top:0px;background-color:rgb(13, 13, 13);filter:alpha(opacity=60);opacity: 0.6;width:100%;height:100%;z-index:8888;"></div>
<div id="addResult2" class="cartTip" style="display:none;">
  <div class="ico-succ"><span class="att-succ">添加成功！</span><span class="cart-succ">套装已成功加入购物车</span></div>
  <div class="cp-lnk"><a href="javascript:void(0);" onclick="document.getElementById('addResult1').style.display = 'none';document.getElementById('addResult2').style.display = 'none';">再逛逛</a><a href="@Url.Action("index", "cart")"><span class="bar"></span>去购物车</a></div>
</div>
<script type="text/javascript">
    //高度需要计算 .bg的高度 = 当前body的高度
    document.getElementById("addResult1").style.height = document.body.scrollHeight + "px";
</script>
</body>
</html>
